home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
mac
/
FILES
/
EDISON.DIR
/
00635_Script_Journal Object --
< prev
next >
Wrap
Text File
|
1997-05-26
|
12KB
|
315 lines
--Journal Object
--Instantiated as gJournalObj
global gInventorIndexNum
global gBulbExpMgr, gWattBIYobj, gTel --These may not be right for Edison
property pCurrentBIYobj, pBIYobjList, pAtBIY
property pClickBoardSpriteNum, pClickBoardRect, pPICTsprite
property pBaseJournalCastNum, pCheckBaseCastNum, pCheckSpriteNum
property pPICTlist
--WATT SPECIFIC PROPERTIES
property pCondensorAxisLocHList, pCylinderAxisLocVList, pWattTopBox, pWattBottomBox
--BELL SPECIFIC PROPERTIES
property pBellLocVList, pBellLocHList, pBellTopBox, pBellMiddleBox, pBellBottomBox
--EDISON SPECIFIC PROPERTIES
property pEdisonLocHList, pEdisonLocVList, pEdisonBox
--INSTANTIATION EXITFRAME SCRIPT for development only: --\
-- set gTel = mInit(script "TelephoneParentScript")
-- set gEdisonBIYobj = 0 --\
-- set gWattBIYobj = 0 --\
-- set gJournalObj = mInit(script "Journal Object")
-- mActivate(gTel) --\
--------------------------------------------------------------------<<ò>>
on mInit me
set pBIYobjList = [gBulbExpMgr, gWattBIYobj, gTel]
set pBaseJournalCastNum = the number of cast "EXPDRY1.PIC"
set pCurrentBIYobj = 0
set pAtBIY = false
-- sprite declarations
set pPICTsprite = 2
set pClickBoardSpriteNum = 19 -- a rect with mJournalClickEvent(gJournalObj) msDn script must be in sprite 20
-- of each BIY. It must be completely offStage
set pCheckSpriteNum = 20 --the check graphic (or placeHolder) must also be off stage in this channel
set pClickBoardRect = rect(60, 80, 420, 440)
set pCheckBaseCastNum = the number of cast "EXPDRY6.PIC"
set pPICTlist = ["EXPDRY1.PIC", "EXPDRY3.PIC", "EXPDRY2.PIC"]
--WATT SPECIFIC PROPERTIES
set pCondensorAxisLocHList = [302, 344, 386]
set pCylinderAxisLocVList = [213, 235, 258, 309, 332, 354]
set pWattTopBox = rect(277, 202, 406, 271)
set pWattBottomBox = rect(277, 298, 406, 367)
--BELL SPECIFIC PROPERTIES
set pBellLocVList = [177,192,206,222,264,279,293,308,355,370,384,400]
set pBellLocHList = [302,328,354]
set pBellTopBox = rect(288, 167, 368, 230)
set pBellMiddleBox = rect(288, 254, 368, 316)
set pBellBottomBox = rect(288, 346, 368, 408)
--EDISON SPECIFIC PROPERTIES
set pEdisonLocHList = [297, 321, 345, 370, 395]
set pEdisonLocVList = [203, 223, 244, 264, 285, 306, 328, 351]
set pEdisonBox = rect(283, 192, 405, 364)
return me
end mInit
--------------------------------------------------------------------<<ò>>
on mActivate me
if pAtBIY then
if (gInventorIndexNum < 4) and (gInventorIndexNum > 0) then
set pCurrentBIYobj = getAt(pBIYobjList, gInventorIndexNum)
-- put "pBIYobjList" && pBIYobjList
-- put "gInventorIndexNum" && gInventorIndexNum
-- put "pCurrentBIYobj:" && pCurrentBIYobj
mSwitchToJournal(pCurrentBIYobj)
puppetSprite pPICTsprite, true
puppetSprite pClickBoardSpriteNum, true
puppetSprite pCheckSpriteNum, true
set the trails of sprite pCheckSpriteNum = true
set the rect of sprite pClickBoardSpriteNum = pClickBoardRect
set the castNum of sprite pPICTsprite = the number of cast getAt(pPICTlist, gInventorIndexNum)
updateStage
if gInventorIndexNum = 1 then
mDrawEdisonChecks(me)
else if gInventorIndexNum = 2 then
mDrawWattChecks(me)
else if gInventorIndexNum = 3 then
mDrawBellChecks(me)
end if
else
alert "gInventorIndexNum is out of range" --\ development only
end if
end if
end mActivate
--------------------------------------------------------------------<<ò>>
on mClose me
puppetSprite pPICTsprite, false
puppetSprite pClickBoardSpriteNum, false
puppetSprite pCheckSpriteNum, false
set the trails of sprite pCheckSpriteNum = false
mSwitchToBIY(pCurrentBIYobj)
end mClose
--------------------------------------------------------------------<<ò>>
on mInformJournal me, argStatus
if argStatus = #ArrivingAtBIY then
set pAtBIY = true
else if argStatus = #LeavingBIY then
set pAtBIY = false
end if
end mInformJournal
--------------------------------------------------------------------<<ò>>
on mJournalClickEvent me
-- put "mJournalClickEvent accessed"
set mousePoint = point(the mouseH, the mouseV)
if gInventorIndexNum = 1 then
mEdisonJrnlClick(me, mousePoint)
else if gInventorIndexNum = 2 then
mWattJrnlClick(me, mousePoint)
else if gInventorIndexNum = 3 then
mBellJrnlClick(me, mousePoint)
end if
dontpassevent
end mJournalClickEvent
--------------------------------------------------------------------<<ò>>
on mEdisonJrnlClick me, argMousePoint
if inside (argMousePoint, pEdisonBox) then
set GridPoint = mRectGridCheck(me, pEdisonBox, argMousePoint, 5, 8) --GridPoint is a list: [x, y]
set CollumClicked = getAt(GridPoint, 1)
set RowClicked = (getAt(GridPoint, 2))
set BIYrecordList = mDiscloseTestRecord(pCurrentBIYobj)
set BIYrecordIndex = (CollumClicked - 1) * 8 + RowClicked
set ClickedACheck = getAt(BIYrecordList, BIYrecordIndex)
if ClickedACheck then
mClose(me)
mReviewExperiment(pCurrentBIYobj, RowClicked, CollumClicked)
end if
else
mClose(me)
end if
end mEdisonJrnlClick
--------------------------------------------------------------------<<ò>>
on mWattJrnlClick me, argMousePoint
if inside(argMousePoint, pWattTopBox) then
set HitaBox = true
set WhichBox = pWattTopBox
set vAdjuster = 0
else if inside(argMousePoint, pWattBottomBox) then
set HitaBox = true
set WhichBox = pWattBottomBox
set vAdjuster = 3
else
set HitaBox = false
mClose(me)
end if
if HitaBox then
set GridPoint = mRectGridCheck(me, WhichBox, argMousePoint, 3, 3) --GridPoint is a list: [x, y]
set CollumClicked = getAt(GridPoint, 1)
set RowClicked = (getAt(GridPoint, 2)) + vAdjuster
mClose(me)
mReviewExperiment(pCurrentBIYobj, RowClicked, Collumclicked)
end if
end mWattJrnlClick
--------------------------------------------------------------------<<ò>>
on mBellJrnlClick me, argMousePoint
if inside(argMousePoint, pBellTopBox) then
set HitaBox = true
set WhichBox = pBellTopBox
set vAdjuster = 0
else if inside(argMousePoint, pBellMiddleBox) then
set HitaBox = true
set WhichBox = pBellMiddleBox
set vAdjuster = 4
else if inside(argMousePoint, pBellBottomBox) then
set HitaBox = true
set WhichBox = pBellBottomBox
set vAdjuster = 8
else
set HitaBox = false
mClose(me)
end if
if HitaBox then
set GridPoint = mRectGridCheck(me, WhichBox, argMousePoint, 3, 4)
set CollumClicked = getAt(GridPoint, 1)
set RowClicked = (getAt(GridPoint, 2)) + vAdjuster
set BellTestRecord = mDiscloseTestRecord(pCurrentBIYobj)
set ExperimentRecordIndex = ((CollumClicked - 1) * 12) + RowClicked
if getAt(BellTestRecord, ExperimentRecordIndex) = 1 then
mClose(me)
mReviewExperiment(pCurrentBIYobj, RowClicked, Collumclicked)
end if
end if
end mBellJrnlClick
--------------------------------------------------------------------<<ò>>
on mRectGridCheck me, argWhichBox, argMousePoint, argNumCollums, argNumRows
set RectWidth = getAt(argWhichBox, 3) - getAt(argWhichBox, 1)
set RectHeight = getAt(argWhichBox, 4) - getAt(argWhichBox, 2)
set RelativeMouseX = getAt(argMousePoint, 1) - getAt(argWhichBox, 1)
set RelativeMouseY = getAt(argMousePoint, 2) - getAt(argWhichBox, 2)
set CollumClicked = RelativeMouseX / (RectWidth / argNumCollums) + 1
set RowClicked = RelativeMouseY / (RectHeight / argNumRows) + 1
return [CollumClicked, RowClicked]
end mRectGridCheck
--------------------------------------------------------------------<<ò>>
on mDrawEdisonChecks me --pEdisonLocHList pEdisonLocVList pEdisonBox
set the castNum of sprite pCheckSpriteNum = pCheckBaseCastNum
set CorrectX = mDiscloseCorrectX(pCurrentBIYobj)
set CorrectY = mDiscloseCorrectY(pCurrentBIYobj)
set BIYrecord = mDiscloseTestRecord(pCurrentBIYobj)
set BIYrecordIndex = 1
put "BIYrecordIndex = " & BIYrecord
repeat with CurrentCollum = 1 to count(pEdisonLocHList)
set xCoordinate = getAt(pEdisonLocHList, CurrentCollum)
repeat with CurrentRow = 1 to count(pEdisonLocVList)
if getAt(BIYrecord, BIYrecordIndex) = true then
set yCoordinate = getAt(pEdisonLocVList, CurrentRow)
if (getPos(pEdisonLocHList, xCoordinate) = CorrectX) and (getPos(pEdisonLocVList, yCoordinate) = CorrectY) then
set the castNum of sprite pCheckSpriteNum = pCheckBaseCastNum + 1 --red checkMark
else
set the castNum of sprite pCheckSpriteNum = pCheckBaseCastNum --black checkMark
end if
set the locH of sprite pCheckSpriteNum = xCoordinate
set the locV of sprite pCheckSpriteNum = yCoordinate
updateStage
end if
set BIYrecordIndex = BIYrecordIndex + 1
end repeat
end repeat
end mDrawEdisonChecks
--------------------------------------------------------------------<<ò>>
on mDrawWattChecks me
set the castNum of sprite pCheckSpriteNum = pCheckBaseCastNum
set CorrectX = mDiscloseCorrectX(pCurrentBIYobj)
set CorrectY = mDiscloseCorrectY(pCurrentBIYobj)
set BIYrecord = mDiscloseTestRecord(pCurrentBIYobj)
set BIYrecordIndex = 1
repeat with CurrentRow = 1 to count(pCylinderAxisLocVList)
set yCoordinate = getAt(pCylinderAxisLocVList, CurrentRow)
repeat with CurrentCollum = 1 to count(pCondensorAxisLocHList)
if getAt(BIYrecord, BIYrecordIndex) = true then
set xCoordinate = getAt(pCondensorAxisLocHList, CurrentCollum)
if (getPos(pCondensorAxisLocHList, xCoordinate) = CorrectX) and (getPos(pCylinderAxisLocVList, yCoordinate) = CorrectY) then
set the castNum of sprite pCheckSpriteNum = pCheckBaseCastNum + 1 --red checkMark
else
set the castNum of sprite pCheckSpriteNum = pCheckBaseCastNum --black checkMark
end if
set the locH of sprite pCheckSpriteNum = xCoordinate
set the locV of sprite pCheckSpriteNum = yCoordinate
updateStage
end if
set BIYrecordIndex = BIYrecordIndex + 1
end repeat
end repeat
end mDrawWattChecks
--------------------------------------------------------------------<<ò>>
on mDrawBellChecks me
set the castNum of sprite pCheckSpriteNum = pCheckBaseCastNum
set CorrectX = mDiscloseCorrectX(pCurrentBIYobj)
set CorrectY = mDiscloseCorrectY(pCurrentBIYobj)
set CorrectZ = mDiscloseCorrectZ(pCurrentBIYobj)
set AdjustedCorrectY = (CorrectZ - 1) * 4 + CorrectY
set BIYrecord = mDiscloseTestRecord(pCurrentBIYobj)
set yCounter = 1
repeat with yCoordinate in pBellLocVList
set xCounter = 1
repeat with xCoordinate in pBellLocHList
set RecordIndex = (xCounter - 1) * 12 + yCounter
if (xCoordinate = CorrectX) and (yCoordinate = AdjustedCorrectY) then
set the castNum of sprite pCheckSpriteNum = pCheckBaseCastNum + 1 --red checkMark
else
set the castNum of sprite pCheckSpriteNum = pCheckBaseCastNum --black checkMark
end if
if getAt(BIYrecord, RecordIndex) =1 then
set the locH of sprite pCheckSpriteNum = xCoordinate
set the locV of sprite pCheckSpriteNum = yCoordinate
updateStage
end if
set xCounter = xCounter + 1
end repeat
set yCounter = yCounter + 1
end repeat
set the locH of sprite pCheckSpriteNum = -500
end mDrawBellChecks
--------------------------------------------------------------------<<ò>>
--------------------------------------------------------------------<<ò>>